Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor PTAL embed creation and Add buttons to PTAL response to make it easier to access #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Adammatthiesen
Copy link
Member

This pull request includes several changes to the ptal command functionality in the src/commands/ptal.ts, src/utils/ptal/editPtalMessage.ts, and src/utils/ptal/makePtalEmbed.ts files. The main updates focus on refactoring the makePtalEmbed function to return more comprehensive interaction and edit options, as well as adding new buttons to the embed messages.

Refactoring and enhancements:

  • src/commands/ptal.ts: Updated the handler function to use the new newInteraction property returned by makePtalEmbed for replying to interactions.
  • src/utils/ptal/editPtalMessage.ts: Modified the editPtalMessage function to use the new edit property returned by makePtalEmbed for editing messages.
  • src/utils/ptal/makePtalEmbed.ts: Added new imports for ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionReplyOptions, and MessageEditOptions from discord.js.

New functionality:

  • src/utils/ptal/makePtalEmbed.ts: Defined a MakePtalEmbed type that includes newInteraction and edit properties, which are used to handle both new interactions and message edits.
  • src/utils/ptal/makePtalEmbed.ts: Enhanced the makePtalEmbed function to include buttons for "See on GitHub" and "View Files" in the embed messages, improving user interaction with pull request notifications.

@Adammatthiesen Adammatthiesen requested review from louisescher and a team as code owners January 17, 2025 12:42
dreyfus92
dreyfus92 previously approved these changes Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants